
<script type="text/javascript">
	var urlBase = "#{view.base}";
</script>
<script type="text/javascript" src="#{view.base}/web-files/js/app_endereco.js"></script>
<script type="text/javascript">
<!-- 

$("form#da-ex-wizard-form-condominio").ready(function(){

	// ...
	var c = $("#da-ex-wizard-form-condominio").validate({onsubmit:false});
	$("#da-ex-wizard-form-condominio").daWizard({
		forwardOnly:false,
		onLeaveStep:function(e,g){return c.form()},
		onBeforeSubmit:function(){return c.form()}
	});

	// Modal CEP
	$("#da-ex-dialog-div-cep").dialog({
		autoOpen:false,
		title:"Busca de Endereço",
		modal:true,width:"640"
		/*/, buttons:[{
			text:"Close Dialog",
			click:function(){
				$(this).dialog("close")
			}
		}]//*/
	});

	// Listener Modal CEP
	$("fieldset#localizacao div.da-form-row div input[name=endereco_cep]").bind("blur",function(d){
		$("#da-ex-dialog-div-cep").dialog("option",{modal:true}).dialog("open");
		searchAddress();
		d.preventDefault();
	});
	
});

//-->
</script>

                    	<div class="grid_3">
                        	<div class="da-panel">
                        	
                            	<div class="da-panel-header">
                            	
                                	<span class="da-panel-title">
                                        <img src="#{view.base}/web-files/images/icons/color/wand.png" alt="" />
                                        #{view.form.title.action} Condomínio
                                    </span>
                                    
                                </div>
                                
                                <div class="da-panel-content">
                                	<form id="da-ex-wizard-form-condominio" class="da-form" action="#{view.base}/condominio/#{view.form.action}" method="post">
                                		
                                		<input type="hidden" name="condominio_id" value="#{view.condominio.id}" />
                                		<input type="hidden" name="endereco_id" value="#{view.endereco.id}" />
                                	
                                    	<fieldset class="da-form-inline">
                                    	
                                        	<legend>Identificação</legend>
                                        	
                                        	<div class="da-form-row">
	                                        	<label>Status <span class="required">*</span></label>
	                                            <div class="da-form-item">
	                                                <div id="da-ex-buttons-radio">
	                                                    <input type="radio" id="radio1" name="condominio_ativo" value="1" #{view.condominio.ativo1} /><label for="radio1">Habilitado</label>
	                                                    <input type="radio" id="radio2" name="condominio_ativo" value="0" #{view.condominio.ativo0} /><label for="radio2">Desabilitado</label>
	                                                </div>
	                                            </div>
                                            </div>
                                        	<div class="da-form-row">
                                            	<label>Nome <span class="required">*</span></label>
                                                <div class="da-form-item large">
                                                	<input type="text" name="condominio_nome" value="#{view.condominio.nome}" class="required" />
                                                </div>
                                            </div>
                                        	<div class="da-form-row">
                                            	<label>Telefone </label>
                                                <div class="da-form-item small">
                                                	<input type="text" name="condominio_telefone" class="telefone" value="#{view.condominio.telefone}" />
                                                </div>
                                            </div>
                                        	<div class="da-form-row">
                                            	<label>CNPJ </label>
                                                <div class="da-form-item small">
                                                	<input type="text" name="condominio_cnpj" class="cnpj" value="#{view.condominio.cnpj}" />
                                                </div>
                                            </div>
                                            
                                        </fieldset>
                                        
                                    	<fieldset class="da-form-inline" id="localizacao">
                                    	
                                        	<legend>Localização</legend>
                                        	
                                        	<div class="da-form-row">
                                            	<label>CEP <span class="required">*</span></label>
                                                <div class="da-form-item small">
                                                	<input type="text" name="endereco_cep" value="#{view.endereco.cep}" class="cep required" />
                                                </div>
                                            </div>
                                        	<div class="da-form-row">
                                            	<label>Logradouro (rua, avenida, etc...) <span class="required">*</span></label>
                                                <div class="da-form-item large">
                                                	<input type="text" name="endereco_logradouro" value="#{view.endereco.logradouro}" class="required" />
                                                </div>
                                            </div>
                                        	<div class="da-form-row">
                                            	<label>Número <span class="required">*</span></label>
                                                <div class="da-form-item small">
                                                	<input type="text" name="endereco_numero" value="#{view.endereco.numero}" class="required" />
                                                </div>
                                            </div>
                                        	<div class="da-form-row">
                                            	<label>Complemento </label>
                                                <div class="da-form-item large">
                                                	<textarea name="endereco_complemento">#{view.endereco.complemento}</textarea>
                                                </div>
                                            </div>
                                        	<div class="da-form-row">
                                            	<label>Bairro <span class="required">*</span></label>
                                                <div class="da-form-item large">
                                                	<input type="text" name="endereco_bairro" value="#{view.endereco.bairro}" class="required" />
                                                </div>
                                            </div>
                                        	<div class="da-form-row">
                                            	<label>Cidade <span class="required">*</span></label>
                                                <div class="da-form-item large">
                                                	<input type="text" name="endereco_cidade" value="#{view.endereco.cidade}" class="required" />
                                                </div>
                                            </div>
                                            
                                            #{view.endereco.estados.select}
                                            
                                        </fieldset>
                                       
				                        <!-- Modal CEP -->
				                        
				                        <div id="da-ex-dialog-div-cep" style="display:none;">
				                        	
				                        	<div style="text-align: center;">
				                        	
				                        		Aguarde buscando endereço...
				                        		<br />&nbsp;<br />
				                        		<img src="#{view.base}/web-files/images/gif/loading.gif" 
                                                    	style="width: 30px; height: 30px; margin-left: 10px;" /> 
				                        	
				                        	</div>
				                        	
				                        </div>
                                        
                                    </form>
                                </div>
                                
                            </div>
                        </div>
                        